import Vue from 'vue'
import Router from 'vue-router'
import routes from '@/router/routers'
import store from '@/store'
import { GetCurrentQueryString } from "@/libs/utils";

Vue.use(Router)

const router = new Router({
    routes
})

router.beforeEach((to, from, next) => {

    /* const user = store.getters.userinfo
    if (!user) {
        const openid = GetCurrentQueryString("openid")
        if (openid) {
            //获取用户信息
            store.dispatch("GetUserInfo", openid)
        } else {
            window.location.href = process.env.VUE_APP_BASE_SERVICE_URL + '/weixin/oauth/oauth_process_userinfo'
        }
    } */

    next()
})

router.afterEach(to => {

})

export default router